#Reading and Writing Filehandles

#!/usr/bin/perl

print "What is your name?\n";
$name = <STDIN>;
print "Hello $name\n";

open(DATA,"<import.txt") or die "Can't open data";
@lines = <DATA>;
close(DATA);


#read Function
#read FILEHANDLE, SCALAR, LENGTH, OFFSET
#read FILEHANDLE, SCALAR, LENGTH

#print Function
#print FILEHANDLE LIST
#print LIST
#print






#Renaming a file
rename ("/usr/test/file1.txt", "/usr/test/file2.txt" );


#Getting File Information

my (@description,$size);
if (-e $file)
{
   push @description, 'binary' if (-B _);
   push @description, 'a socket' if (-S _);
   push @description, 'a text file' if (-T _);
   push @description, 'a block special file' if (-b _);
   push @description, 'a character special file' if (-c _);
   push @description, 'a directory' if (-d _);
   push @description, 'executable' if (-x _);
   push @description, (($size = -s _)) ? "$size bytes" : 'empty';
   print "$file is ", join(', ',@description),"\n";
}